The invention relates to the recovery of data in a distributed system and particularly to the recovery of data between a master database and in its slave database(s).
The present invention relates particularly to the recovery of data in exchanges of mobile communication systems, although the invention can also be utilized in any system comprising a distributed multiple database system, i.e. a system where data is stored and maintained in at least two different databases. In the following, the invention is described by way of example with reference to mobile communication systems in particular.
In mobile communication systems where several exchanges offer services to the same subscribers, there is the need to maintain for example subscriber location information in multiple exchanges and to transmit this information from one exchange to another. Such a need to transmit subscriber information exists for example in situations where a subscriber moves from one location area to another. Thus, it must be possible to transmit said location area change to all the exchanges maintaining data concerning the location of the subscriber. If data transmission to all the exchanges requiring the information fails, there is a risk of mutually inconsistent data concerning an individual subscriber in databases in different exchanges.
Another situation where there is a risk of mutually inconsistent data is when one of the databases has to be driven down. Since the down-driven database cannot continuously update the changes that have taken place in the data, the data may change in the meantime in the other databases, but remains unchanged in said down-driven database. As a consequence, the data contained in the databases becomes inconsistent, on the one hand in the down-driven database and on the other hand in other normally functioning databases.
The database contents of various databases are maintained consistent by so called periodic recovery. In previously known solutions, in the recovery, all data is transmitted and copied, i.e. dumped, from one database to the other database(s). A problem with this is that all of the data is dumped regardless of whether the data, or part of the data, is the same in the databases. Thus the recovery causes an unnecessarily high load to the network and at least part of the data is transmitted in vain. Brief description of the invention
An object of the invention is to provide a method and an apparatus implementing the method to eliminate the above problem. The object is achieved with a method, a system and network nodes which are characterized in what is disclosed in the independent claims. The preferred embodiments of the invention are set forth in the dependent claims.
The invention is based on finding those data elements in the data which need to be updated by comparing the total of a data element in one database with the total of a corresponding data element in the other database(s). If the totals are the same, there is no need to update the data element. A ‘total’ refers here to all information compact enough from which it can be unequivocally deduced whether the data in a database is the same as the data in another database. The ‘total’ can, for example, be a sum which is obtained by calculating the data according to a predefined calculation method. Examples of different kind of totals are a checksum, a check total, a proof total and a hash total. An age indicator, e.g. a time stamp, may also be a total in systems where a difference between age indicators implies that data is different.
The most important advantage of the invention is that only the data elements which differ are updated. Thus no data is transmitted in vain and the network load is minimized.
In a preferred embodiment of the invention, after the need for an update is recognized, in the database in which the totals are compared, a deduction is made as to whether the data element should be updated in the database or in the other database. On the basis of this deduction the database either starts to update the data element to the other database or indicates the other database in which this data element should be updated. A further advantage of this embodiment is that it enables updating from both databases during one data recovery session.
In another preferred embodiment of the invention, a total calculated from the data in one database is compared with a total calculated from the corresponding data in the other database, and only if the totals differ are the data elements which need to be updated searched by a detailed comparison of the data elements. A further advantage of this embodiment is that the databases are not unnecessarily loaded by the detailed comparison of the data elements.